<CFSET sMessPostApproval = "">
<CFQUERY NAME="qryOR" DATASOURCE="#client.company_dsn#">
	SELECT *
	FROM   ECINOFFICIALRECEIPT
	WHERE  ROUTEID = '#GetRecord.ROUTEID#'
</CFQUERY>
<CFIF qryOR.RecordCount>
	<CFIF qryOR.BSNUMBER NEQ "">
		<CFQUERY NAME="qryBS" DATASOURCE="#client.company_dsn#">
			SELECT *
			FROM   CINTLOOBILLSTMNT
			WHERE  BSNUMBER = '#qryOR.BSNUMBER#'
		</CFQUERY>
		<CFIF qryBS.BSNUMBER NEQ "">
			<CFTRY>
				UPDATE CINTLOOBILLSTMNT
				SET BSSTATUS = 'PAID', BSDATE = 'getDate()'
				WHERE BSNUMBER = '#qryBS.BSNUMBER#'
			<CFCATCH TYPE="ANY">
				<CFSET sMessPostApproval = "#CFCATCH.MESSAGE# - #CFCATCH.DETAILS#">
			</CFCATCH>
			</CFTRY>
		</CFIF>
	</CFIF>
</CFIF>